<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <home></home>
  </div>
 <script src="./vue.js"></script>
 <script>
    /* const Home = {
      render: (createElement) => {
        // createElement生成对应虚拟dom 生成一个虚拟标签
        return createElement(
          'div', 
          {
            id: 'box',
            className: 'wrap'
          },
          [
            createElement('p',{className: 'op'}, ['这是p']),
            createElement('span',{},['这是span']),
            '这是文本'
          ]
        )
      }
    } */
    const homeTemplate = {
      template: `
        <div>
          <button>按钮</button>  
        </div>
      `
    }
    // render直接传入options
    const Home = {
      render: (createElement) => {
        return createElement(homeTemplate)
      }
    }
    Vue.component('Home', Home)
    const vm = new Vue({
      el: '#app'
    })
 </script>
</body>
</html>